﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace Autorun
{
	[RunInstaller(true)]
	public partial class ProjectInstaller : Installer
	{
		private ServiceInstaller serviceInstaller;
		private ServiceProcessInstaller processInstaller;

		public ProjectInstaller()
		{
			InitializeComponent();

			processInstaller = new ServiceProcessInstaller();
			serviceInstaller = new ServiceInstaller();

			// Service will run under system account
			processInstaller.Account = ServiceAccount.LocalService;

			// Service will have Start Type of Manual
			serviceInstaller.StartType = ServiceStartMode.Manual;

			serviceInstaller.ServiceName = string.Format("Autorun Server ({0})", ApplicationStartInfo.Instance);

			Installers.Add(serviceInstaller);
			Installers.Add(processInstaller);
		}
	}
}
